<!--
// +----------------------------------------------------------------------
// | Created by PHPstorm: JRKAdmin框架 [ JRKAdmin ]
// +----------------------------------------------------------------------
// | Copyright (c) 2019~2022 [LuckyHHY] All rights reserved.
// +----------------------------------------------------------------------
// | SiteUrl: http://www.luckyhhy.cn
// +----------------------------------------------------------------------
// | Author: LuckyHhy <jackhhy520@qq.com>
// +----------------------------------------------------------------------
// | Date: 2020/1/3-16:21
// +----------------------------------------------------------------------
// | Description:
// +----------------------------------------------------------------------
*-->

{extend name='public/base' /}


{block name="content"}

<div class="layui-col-md12">

    <div class="layui-card">

        <div class="layui-card-body">

            <div class="layui-card-header">设置我的资料</div>
            <div class="layui-card-body" >

                <div class="layui-form" lay-filter="">

                    <div class="layui-form-item">
                        <label class="layui-form-label">所属角色：</label>
                        <div class="layui-input-inline">
                            <input type="text" disabled value="{$role_name}"  class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">管理员所属的角色</div>
                        <input type="hidden" name="id"  value="{$info.id}">
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">头像：</label>
                        {:widget('common/forms/uploadImg',array('avatar',$info['avatar'],'90x90','头像','300x300'))}
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="username" lay-verify="required" value="{$info.username}"  class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">一般用于后台登入名</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">昵称：</label>
                        <div class="layui-input-inline">
                            <input type="text" name="nickname" value="{$info.nickname}" lay-verify="required" autocomplete="off" placeholder="请输入昵称" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">管理员昵称用于后台显示</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">性别：</label>
                        <div class="layui-input-block">
                            <input type="radio" name="sex" value="男" {eq name="$info.sex" value="男" }  checked {/eq} title="男">
                            <input type="radio" name="sex" value="女" {eq name="$info.sex" value="女" }  checked {/eq} title="女" >
                        </div>
                    </div>


                    {:token()}

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="setmyinfo">确认修改</button>
                        </div>
                    </div>
                </div>

            </div>


        </div>
    </div>

</div>


{/block}

{block name="js"} <!--js处理区-->

<script>

    layui.use(['element','form', 'jquery','lucky'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;

        form.render();

        /**
         * 表格提交
         */
        form.on('submit(setmyinfo)', function (data) {
            lucky.FormSubmit("{:url('setting/index')}",data.field);
            return false;
        });

    });

</script >


{/block}
